fix: sanitize uploaded filenames before storage to match LibreChat#32
Merged
aron-muon merged 1 commit intoaron-muon:mainfrom Feb 9, 2026
Merged
fix: sanitize uploaded filenames before storage to match LibreChat#32aron-muon merged 1 commit intoaron-muon:mainfrom
aron-muon merged 1 commit intoaron-muon:mainfrom
Conversation
LibreChat translates spaces and special characters in filenames to underscores, but KCR was storing the original unsanitized name. This caused the model to fail on first file access since the name on disk didn't match what LibreChat reported.
aron-muon
approved these changes
Feb 9, 2026
|
🎉 This PR is included in version 2.1.3 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When files are uploaded via LibreChat, LibreChat sanitizes filenames (replacing spaces and special characters with underscores) before telling the model about them. However, KCR was storing files with the original unsanitized filename. This meant the model would try to open
my_file.csvbut the file on disk in the pod was actuallymy file.csv, causing the first execution to fail. The model would then have to list the directory, discover the real name, and retry.This fix moves filename sanitization to happen before storage, so the name on disk matches what LibreChat reports.
Type of change
How Has This Been Tested?
&,#,!@#$, and unicode charactersChecklist: